[#625] Fix EIP-712 chainId signing failure in Farcaster miniapp#626
[#625] Fix EIP-712 chainId signing failure in Farcaster miniapp#626realproject7 merged 1 commit intomainfrom
Conversation
Farcaster wallet expects chainId as a number, but BigInt(BASE_CHAIN_ID) gets serialized to string "8453" by viem's stringify, causing "Unable to parse chainId" errors. BASE_CHAIN_ID is already a Number, so the BigInt wrapping was unnecessary. Fixes #625 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Verified: BASE_CHAIN_ID is already Number in lib/contracts/constants.ts (line 14: const chainId = Number(process.env.NEXT_PUBLIC_CHAIN_ID || "84532")). The BigInt() wrapping was redundant and caused viem's stringify to serialize chainId as a string, breaking Farcaster wallet's EIP-712 parser. Minimal, correct fix — two lines changed, build passes.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
This PR makes the scoped EIP-712 domain fix requested in issue #625 by changing the chainId field from BigInt(BASE_CHAIN_ID) to Number(BASE_CHAIN_ID) in both affected components.
Findings
- No findings.
Decision
Approve. The diff is minimal, matches the issue acceptance criteria at the code level, and avoids the BigInt-to-string serialization problem described for Farcaster signing.
Summary
BigInt(BASE_CHAIN_ID)→Number(BASE_CHAIN_ID)in EIP-712 domain config in bothAgentManage.tsxandAgentRegister.tsxBASE_CHAIN_IDis already aNumberinconstants.ts— theBigIntwrapping caused viem'sstringifyto serialize it as string"8453", which the Farcaster wallet rejects with "Unable to parse chainId"Test plan
setAgentWalletEIP-712 signing — should no longer error with "Unable to parse chainId"Fixes #625
🤖 Generated with Claude Code